package com.hwl.eduservice.controller.admin;

import com.hwl.commonutils.result.RespBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@Api(tags = "临时登录接口")
@RestController
@RequestMapping("/user")
public class LoginController {


    @ApiOperation("登录返回token")
    @PostMapping("login")
    public RespBean login() {
        return RespBean.ok().data("naive");
    }

    @ApiOperation("登录获取用户信息")
    @GetMapping("info")
    public RespBean getInfo() {
        Map<String, Object> map = new HashMap<>();
        map.put("name", "hwl");
        map.put("roles", "[admin]");
        map.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return RespBean.ok().data(map);
    }

    @ApiOperation("退出登录")
    @PostMapping("logout")
    public RespBean logout(){
        return RespBean.ok();
    }


}
